package prototype.deepClone;

/**
 * @author： pang-yun
 * @date： 2021-10-22 13:59
 * 功能目的 ：用于
 */

public class DeepTest {
    public static void main(String[] args) throws CloneNotSupportedException {
        DeepPrototype deepPrototype = new DeepPrototype();
        deepPrototype.setName("AAA");
        deepPrototype.setTarget(new DeepCloneableTarget("a","a.class"));

        DeepPrototype clone = (DeepPrototype) deepPrototype.clone();

        System.out.println(deepPrototype+" hashCode"+deepPrototype.hashCode());
        System.out.println(clone +" hashCode"+clone.hashCode());

        // 方式二 实现 深拷贝
        DeepPrototype deep = (DeepPrototype) deepPrototype.deepClone();
        System.out.println(deep+ "hashCode "+deep.hashCode());

    }
}
